<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "city".
 *
 * @property int $_id
 * @property string $city_id
 * @property string $name
 * @property string $province_id
 */
class City extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'city';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['_id'], 'required'],
            [['_id'], 'integer'],
            [['city_id', 'province_id'], 'string', 'max' => 8],
            [['name'], 'string', 'max' => 32],
            [['_id'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            '_id'         => 'Id',
            'city_id'     => 'City ID',
            'name'        => 'Name',
            'province_id' => 'Province ID',
        ];
    }
}
